from torchsummary import summary
from torchvision.models import resnet18  # 以 resnet18 为例

myNet = resnet18().cuda()  # 实例化网络，可以换成自己的网络
myNet.eval()
summary(myNet, (3, 64, 64))  # 输出网络结构

with open('resnet18.txt', 'w') as f:
    f.write(str(myNet))